﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Geometry
{
    [TypeConverter(typeof(PointConverter))]
    public struct Point
    {
        public double X { get; set; }
        public double Y { get; set; }

        public Point(double x, double y)
            : this()
        {
            X = x;
            Y = y;
        }

        public static Vector Subtract(Point p2, Point p1)
        {
            return new Vector(p2.X - p1.X, p2.Y - p1.Y);
        }

        public static Vector operator-(Point p2, Point p1)
        {
            return Subtract(p2, p1);
        }

    }
}
